﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IFTRUE.FMS
{
    /// <summary>
    /// 作用：会话管理类
    /// 作者：iftrue
    /// 日期：2013-08-19
    /// </summary>
    public class MySession
    {
        private static Model.MySession _currentUser;

        /// <summary>
        /// 当前会话中的用户信息
        /// </summary>
        public static Model.MySession CurrentUser
        {
            get { return (Model.MySession)System.Web.HttpContext.Current.Session["currentuser"]; }
            set { MySession._currentUser = value; }
        }

        /// <summary>
        /// 关闭（清空）当前Session
        /// </summary>
        public static void CloseSession()
        {
            MySession.CurrentUser = null;
            System.Web.HttpContext.Current.Session.Clear();
            System.Web.HttpContext.Current.Session.Abandon();
        }
    }
}
